<!--
描述：教学计划-年级管理-新增组件
开发人：hqj
开发日期：2018年8月7日
-->
<template lang="pug">
    kalix-dialog.user-add(bizKey="grade" ref="kalixBizDialog" v-bind:formModel.sync="formModel" v-bind:targetURL="targetURL")
        div.el-form(slot="dialogFormSlot")
            el-form-item(label="年级" prop="grade" v-bind:rules="rules.grade" v-bind:label-width="labelWidth")
                kalix-date-picker(v-model="formModel.grade" type="year")
            el-form-item(label="起始日期" prop="startDate" v-bind:rules="rules.startDate" v-bind:label-width="labelWidth")
                kalix-date-picker(v-model="formModel.startDate")
            el-form-item(label="结束日期" prop="endDate" v-bind:rules="rules.endDate" v-bind:label-width="labelWidth")
                kalix-date-picker(v-model="formModel.endDate")
</template>

<script type="text/ecmascript-6">
    import FormModel from './model'
    import {gradeURL} from '../../config.toml'

    export default {
        name: 'GradeAdd',
        data() {
            return {
                formModel: Object.assign({}, FormModel),
                rules: {
                    grade: [{required: true, message: '请选择年级', trigger: 'change'}],
                    startDate: [{required: true, message: '请选择起始日期', trigger: 'change'}],
                    endDate: [{required: true, message: '请选择结束日期', trigger: 'change'}]
                },
                targetURL: gradeURL,
                labelWidth: '140px'
            }
        },
        created() {
        },
        methods: {}
    }
</script>
